package javacode.chapter04;

import java.util.Scanner;

public class Example4_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入本金：");
        double principal = scanner.nextDouble(); //本金
        double total; //本息总额
        double rate = 1.75 / 100; //年利率
        double interest;

        System.out.println("本金为：" + principal);
        //计算本金存满一年后的利息
        interest = principal * rate;
        //计算本金丰满一年后的本息总额
        total = principal + interest;
        System.out.println("存满一年后的本息总额是：" + total);
    }
}
